FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g24d8db4.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g24d8db4.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=24d8db4 OS_GIT_VERSION=4.10.0-202202160023.p0.g24d8db4.assembly.stream-24d8db4 SOURCE_DATE_EPOCH=1643205617 SOURCE_GIT_COMMIT=24d8db40f7544806bf6e5acc32f56e223a59eed7 SOURCE_GIT_TAG=v4.0.0-310-g24d8db40f SOURCE_GIT_URL=https://github.com/openshift/builder 
WORKDIR /go/src/github.com/openshift/builder
COPY . .
RUN hack/build.sh

FROM openshift/base-rhel8:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g24d8db4.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g24d8db4.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=24d8db4 OS_GIT_VERSION=4.10.0-202202160023.p0.g24d8db4.assembly.stream-24d8db4 SOURCE_DATE_EPOCH=1643205617 SOURCE_GIT_COMMIT=24d8db40f7544806bf6e5acc32f56e223a59eed7 SOURCE_GIT_TAG=v4.0.0-310-g24d8db40f SOURCE_GIT_URL=https://github.com/openshift/builder 
RUN INSTALL_PKGS=" \
      bind-utils bsdtar findutils fuse-overlayfs git hostname lsof \
      procps-ng runc socat tar tree util-linux wget which \
      " && \
    yum install -y --setopt=skip_missing_names_on_install=False $INSTALL_PKGS && \
    yum clean all
RUN rpm --setcaps shadow-utils
COPY --from=builder /go/src/github.com/openshift/builder/openshift-builder /usr/bin/
COPY imagecontent/bin /usr/bin
COPY imagecontent/etc/containers /etc/containers
COPY imagecontent/usr/share/containers /usr/share/containers
RUN mkdir -p /var/cache/blobs \
    /var/lib/shared/overlay-images \
    /var/lib/shared/overlay-layers \
    /etc/pki/tls/certs /etc/docker/certs.d && \
    chmod g+w /etc/pki/tls/certs /etc/docker/certs.d && \
    touch /var/lib/shared/overlay-images/images.lock \
    /var/lib/shared/overlay-layers/layers.lock

RUN ln -s /usr/bin/openshift-builder /usr/bin/openshift-sti-build && \
    ln -s /usr/bin/openshift-builder /usr/bin/openshift-docker-build && \
    ln -s /usr/bin/openshift-builder /usr/bin/openshift-git-clone && \
    ln -s /usr/bin/openshift-builder /usr/bin/openshift-manage-dockerfile && \
    ln -s /usr/bin/openshift-builder /usr/bin/openshift-extract-image-content
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]

LABEL \
        io.k8s.display-name="OpenShift Container Platform Container Builder" \
        io.k8s.description="This is a component of OpenShift Container Platform and is responsible for executing container image builds." \
        io.openshift.tags="openshift,builder" \
        License="GPLv2+" \
        vendor="Red Hat" \
        name="openshift/ose-docker-builder" \
        com.redhat.component="openshift-enterprise-builder-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Build" \
        release="202202160023.p0.g24d8db4.assembly.stream" \
        io.openshift.build.commit.id="24d8db40f7544806bf6e5acc32f56e223a59eed7" \
        io.openshift.build.source-location="https://github.com/openshift/builder" \
        io.openshift.build.commit.url="https://github.com/openshift/builder/commit/24d8db40f7544806bf6e5acc32f56e223a59eed7" \
        version="v4.10.0"

